{% comment %}
  Copyright 2008 Gabriel Sean Farrell

  This file is part of Kochief.

  Kochief is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  Kochief is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with Kochief.  If not, see <http://www.gnu.org/licenses/>.
{% endcomment %}
{% load i18n %}
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <title>{% trans "Kochief" %}{% block title %}{% endblock %}</title>
    <link href="{{ MEDIA_URL }}base.css" type="text/css" rel="stylesheet" media="screen" />
    <script src="{{ MEDIA_URL }}js/base.js" type="text/javascript"></script>
    {% block head %}{% endblock %}
    <script type="text/javascript">
      {% if search_history %}
        addEventSimple(window, 'load', searchHistClick);
      {% endif %}
    </script>
  </head>
  <body>
    <div id="container">
      <div id="header">
        <h1 id="logo"><a href="{% url discovery-index %}"><span>Kochief</span></a></h1>
        <div id="searchform">
          <form action="{% url discovery-search %}" name="search">
            <input type="text" id="id_query" name="q" value="{{ query }}"/>
            {% comment %}
            <!-- commented out in favor of power and advanced search -->
            <select name="field" id="id_field"> 
              {% for name, field in fields %}
                <option value="{{ field }}"{% ifequal field current_field %} selected="true"{% endifequal %}>{{ name }}</option>
              {% endfor %}
            </select>
            {% endcomment %}
            <input type="submit" value="{% trans "Search" %}"/>
          </form>
        </div>  
        {% if search_history %}
          <div id="search-history">
            <a href="{{ last_search }}">&larr; {% trans "Last search" %}</a>
            <a id="search-history-link" href="{% url discovery-search %}?history=1">&rarr; {% trans "Search history" %}</a>
          </div>
          <div id="search-history-list" class="hidden">{% include "discovery/snippets/search_history.html" %}</div>
        {% endif %}
      </div>
      <div id="content">
        {% block content %}{% endblock %}
      </div>
    </div>
    <div id="powered">Powered by <a href="http://kochief.org">Kochief</a>.</div>
  </body>
</html>
